package com.example.springboot.config.anotation.conditionOn.confitional;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @Author:ChenZhangKun
 * @Date: 2023/7/9 15:13
 */
@Configuration
public class ServiceBeanConfiguration {
    @Bean
    @Conditional(ChinaCondition.class) // 中文环境才注入
    public ChinaServiceBean chinaServiceBean(){
        System.out.println("=====中文环境注入了======");
        return new ChinaServiceBean();
    }
}
